package com.mebs.model.reports;

import com.mebs.model.AuditInfo;
import com.mebs.model.Company;
import com.mebs.model.Project;
import com.mebs.model.logistics.Air;
import com.mebs.model.logistics.Ocean;
import com.mebs.model.logistics.Truck;
import org.jt.jet.annotation.ArgumentType;
import org.jt.jet.annotation.Field;

import javax.persistence.*;

/**
 * User: epb
 * Date: 10.02.2009
 * Time: 17:44:12
 */

@Entity()
//@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "REPORT_TEMPLATE")
public class ReportTemplate {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "Id")
	private Long id;

	@Column(name = "Name", nullable = false, length = 250)
	private String name;

	@ManyToOne(optional = false)
	@JoinColumn(name = "CompanyId")
	@Field(type = ArgumentType.INSTANCE)
	private Company company;

	@ManyToOne(optional = true)
	@JoinColumn(name = "ProjectId")
	@Field(type = ArgumentType.INSTANCE)
	private Project project;

//	@ManyToOne(optional = true)
//	@JoinColumn(name = "AirId")
//	@Field(type = ArgumentType.INSTANCE)
//	private Air air;
//
//	@ManyToOne(optional = true)
//	@JoinColumn(name = "OceanId")
//	@Field(type = ArgumentType.INSTANCE)
//	private Ocean ocean;
//
//	@ManyToOne(optional = true)
//	@JoinColumn(name = "TruckId")
//	@Field(type = ArgumentType.INSTANCE)
//	private Truck truck;

	@Column(name = "reportType", nullable = false)
	private Integer reportType;

	@Column(name = "shipper", nullable = true)
	private Boolean shipper;

	@Column(name = "consignee", nullable = true)
	private Boolean consignee;

	@Column(name = "destination", nullable = true)
	private Boolean destination;

	@Column(name = "pnotify", nullable = true)
	private Boolean pnotify;

	@Column(name = "refnumber", nullable = true)
	private Boolean refnumber;

	@Column(name = "date", nullable = true)
	private Boolean date;

	@Column(name = "piecies", nullable = true)
	private Boolean piecies;

	@Column(name = "weight", nullable = true)
	private Boolean weight;

	@Column(name = "commodity", nullable = true)
	private Boolean commodity;

	@Column(name = "value", nullable = true)
	private Boolean value;

	@Column(name = "bottomtext", nullable = true)
	private Boolean bottomtext;

	@Column(name = "mebsnumber", nullable = true)
	private Boolean mebsnumber;

	@Column(name = "tbox", nullable = true)
	private Boolean tbox;

	@Column(name = "trefnumber", nullable = true)
	private Boolean trefnumber;

	@Column(name = "tcommodity", nullable = true)
	private Boolean tcommodity;

	@Column(name = "tpartnumber", nullable = true)
	private Boolean tpartnumber;

	@Column(name = "tweight", nullable = true)
	private Boolean tweight;

	@Column(name = "tdims", nullable = true)
	private Boolean tdims;

	@Column(name = "tqty", nullable = true)
	private Boolean tqty;

	@Column(name = "twon", nullable = true)
	private Boolean twon;

	@Column(name = "tmtpo", nullable = true)
	private Boolean tmtpo;

	@Column(name = "tunitvalue", nullable = true)
	private Boolean tunitvalue;

	@Column(name = "ttotalvalue", nullable = true)
	private Boolean ttotalvalue;

	@Column(name = "sumtotalvalue", nullable = true)
	private Boolean sumtotalvalue;

	@Column(name = "comment", nullable = true)
	private Boolean comment;

	@Column(name = "signname", nullable = true)
	private Boolean signname;

	// Excel part

	@Column(name = "emtpo", nullable = true)
	private Boolean emtpo;

	@Column(name = "ewon", nullable = true)
	private Boolean ewon;

	@Column(name = "epri", nullable = true)
	private Boolean epri;

	@Column(name = "ecommodity", nullable = true)
	private Boolean ecommodity;

	@Column(name = "epartnumber", nullable = true)
	private Boolean epartnumber;

	@Column(name = "eitemcost", nullable = true)
	private Boolean eitemcost;

	@Column(name = "eqty", nullable = true)
	private Boolean eqty;

	@Column(name = "etotal", nullable = true)
	private Boolean etotal;

	@Column(name = "ecnt", nullable = true)
	private Boolean ecnt;

	@Column(name = "edestination", nullable = true)
	private Boolean edestination;

	@Column(name = "eref", nullable = true)
	private Boolean eref;

	@Column(name = "eshipper", nullable = true)
	private Boolean eshipper;

	@Column(name = "eawb", nullable = true)
	private Boolean eawb;

	@Column(name = "eshipdate", nullable = true)
	private Boolean eshipdate;

	@Column(name = "edeldate", nullable = true)
	private Boolean edeldate;

	@Column(name = "eremarks", nullable = true)
	private Boolean eremarks;

	@Column(name = "erc", nullable = true)
	private Boolean erc;

	@Column(name = "edate", nullable = true)
	private Boolean edate;

	@Column(name = "evendor", nullable = true)
	private Boolean evendor;

	@Column(name = "edim", nullable = true)
	private Boolean edim;

	@Column(name = "eweight", nullable = true)
	private Boolean eweight;

	@Column(name = "eshippingpo", nullable = true)
	private Boolean eshippingpo;

	@Column(name = "eshiplot", nullable = true)
	private Boolean eshiplot;

	@Embedded
	private AuditInfo auditInfo;

	@Transient
	public void setAllToTrue() {
		shipper = consignee = destination = pnotify = refnumber
				= date = piecies = weight = commodity = value = bottomtext = mebsnumber
				= tbox = trefnumber = tcommodity = tpartnumber = tweight = tdims
				= tqty = twon = tmtpo = tunitvalue = ttotalvalue = sumtotalvalue
				= comment = signname = emtpo = ewon = epri = ecommodity = epartnumber
				= eitemcost = eqty = etotal = ecnt = edestination = eref = eshipper
				= eawb = eshipdate = edeldate = eremarks = erc = edate = evendor = edim
				= eweight = eshippingpo = eshiplot = true;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Company getCompany() {
		return company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

//	public Air getAir() {
//		return air;
//	}
//
//	public void setAir(Air air) {
//		this.air = air;
//	}
//
//	public Ocean getOcean() {
//		return ocean;
//	}
//
//	public void setOcean(Ocean ocean) {
//		this.ocean = ocean;
//	}
//
//	public Truck getTruck() {
//		return truck;
//	}
//
//	public void setTruck(Truck truck) {
//		this.truck = truck;
//	}

	public AuditInfo getAuditInfo() {
		if (this.auditInfo == null) {
			this.auditInfo = new AuditInfo();
		}
		return auditInfo;
	}

	public void setAuditInfo(AuditInfo auditInfo) {
		this.auditInfo = auditInfo;
	}

	public Integer getReportType() {
		return reportType;
	}

	public void setReportType(Integer reportType) {
		this.reportType = reportType;
	}

	public Boolean getShipper() {
		return shipper;
	}

	public void setShipper(Boolean shipper) {
		this.shipper = shipper;
	}

	public Boolean getConsignee() {
		return consignee;
	}

	public void setConsignee(Boolean consignee) {
		this.consignee = consignee;
	}

	public Boolean getPnotify() {
		return pnotify;
	}

	public void setPnotify(Boolean pnotify) {
		this.pnotify = pnotify;
	}

	public Boolean getRefnumber() {
		return refnumber;
	}

	public void setRefnumber(Boolean refnumber) {
		this.refnumber = refnumber;
	}

	public Boolean getDate() {
		return date;
	}

	public void setDate(Boolean date) {
		this.date = date;
	}

	public Boolean getPiecies() {
		return piecies;
	}

	public void setPiecies(Boolean piecies) {
		this.piecies = piecies;
	}

	public Boolean getWeight() {
		return weight;
	}

	public void setWeight(Boolean weight) {
		this.weight = weight;
	}

	public Boolean getCommodity() {
		return commodity;
	}

	public void setCommodity(Boolean commodity) {
		this.commodity = commodity;
	}

	public Boolean getValue() {
		return value;
	}

	public void setValue(Boolean value) {
		this.value = value;
	}

	public Boolean getBottomtext() {
		return bottomtext;
	}

	public void setBottomtext(Boolean bottomtext) {
		this.bottomtext = bottomtext;
	}

	public Boolean getMebsnumber() {
		return mebsnumber;
	}

	public void setMebsnumber(Boolean mebsnumber) {
		this.mebsnumber = mebsnumber;
	}

	public Boolean getTbox() {
		return tbox;
	}

	public void setTbox(Boolean tbox) {
		this.tbox = tbox;
	}

	public Boolean getTrefnumber() {
		return trefnumber;
	}

	public void setTrefnumber(Boolean trefnumber) {
		this.trefnumber = trefnumber;
	}

	public Boolean getTcommodity() {
		return tcommodity;
	}

	public void setTcommodity(Boolean tcommodity) {
		this.tcommodity = tcommodity;
	}

	public Boolean getTpartnumber() {
		return tpartnumber;
	}

	public void setTpartnumber(Boolean tpartnumber) {
		this.tpartnumber = tpartnumber;
	}

	public Boolean getTweight() {
		return tweight;
	}

	public void setTweight(Boolean tweight) {
		this.tweight = tweight;
	}

	public Boolean getTdims() {
		return tdims;
	}

	public void setTdims(Boolean tdims) {
		this.tdims = tdims;
	}

	public Boolean getTqty() {
		return tqty;
	}

	public void setTqty(Boolean tqty) {
		this.tqty = tqty;
	}

	public Boolean getTwon() {
		return twon;
	}

	public void setTwon(Boolean twon) {
		this.twon = twon;
	}

	public Boolean getTmtpo() {
		return tmtpo;
	}

	public void setTmtpo(Boolean tmtpo) {
		this.tmtpo = tmtpo;
	}

	public Boolean getTunitvalue() {
		return tunitvalue;
	}

	public void setTunitvalue(Boolean tunitvalue) {
		this.tunitvalue = tunitvalue;
	}

	public Boolean getTtotalvalue() {
		return ttotalvalue;
	}

	public void setTtotalvalue(Boolean ttotalvalue) {
		this.ttotalvalue = ttotalvalue;
	}

	public Boolean getSumtotalvalue() {
		return sumtotalvalue;
	}

	public void setSumtotalvalue(Boolean sumtotalvalue) {
		this.sumtotalvalue = sumtotalvalue;
	}

	public Boolean getEmtpo() {
		return emtpo;
	}

	public void setEmtpo(Boolean emtpo) {
		this.emtpo = emtpo;
	}

	public Boolean getEwon() {
		return ewon;
	}

	public void setEwon(Boolean ewon) {
		this.ewon = ewon;
	}

	public Boolean getEpri() {
		return epri;
	}

	public void setEpri(Boolean epri) {
		this.epri = epri;
	}

	public Boolean getEcommodity() {
		return ecommodity;
	}

	public void setEcommodity(Boolean ecommodity) {
		this.ecommodity = ecommodity;
	}

	public Boolean getEpartnumber() {
		return epartnumber;
	}

	public void setEpartnumber(Boolean epartnumber) {
		this.epartnumber = epartnumber;
	}

	public Boolean getEitemcost() {
		return eitemcost;
	}

	public void setEitemcost(Boolean eitemcost) {
		this.eitemcost = eitemcost;
	}

	public Boolean getEqty() {
		return eqty;
	}

	public void setEqty(Boolean eqty) {
		this.eqty = eqty;
	}

	public Boolean getEtotal() {
		return etotal;
	}

	public void setEtotal(Boolean etotal) {
		this.etotal = etotal;
	}

	public Boolean getEcnt() {
		return ecnt;
	}

	public void setEcnt(Boolean ecnt) {
		this.ecnt = ecnt;
	}

	public Boolean getEdestination() {
		return edestination;
	}

	public void setEdestination(Boolean edestination) {
		this.edestination = edestination;
	}

	public Boolean getEref() {
		return eref;
	}

	public void setEref(Boolean eref) {
		this.eref = eref;
	}

	public Boolean getEshipper() {
		return eshipper;
	}

	public void setEshipper(Boolean eshipper) {
		this.eshipper = eshipper;
	}

	public Boolean getEawb() {
		return eawb;
	}

	public void setEawb(Boolean eawb) {
		this.eawb = eawb;
	}

	public Boolean getEshipdate() {
		return eshipdate;
	}

	public void setEshipdate(Boolean eshipdate) {
		this.eshipdate = eshipdate;
	}

	public Boolean getEdeldate() {
		return edeldate;
	}

	public void setEdeldate(Boolean edeldate) {
		this.edeldate = edeldate;
	}

	public Boolean getEremarks() {
		return eremarks;
	}

	public void setEremarks(Boolean eremarks) {
		this.eremarks = eremarks;
	}

	public Boolean getErc() {
		return erc;
	}

	public void setErc(Boolean erc) {
		this.erc = erc;
	}

	public Boolean getEdate() {
		return edate;
	}

	public void setEdate(Boolean edate) {
		this.edate = edate;
	}

	public Boolean getEvendor() {
		return evendor;
	}

	public void setEvendor(Boolean evendor) {
		this.evendor = evendor;
	}

	public Boolean getEdim() {
		return edim;
	}

	public void setEdim(Boolean edim) {
		this.edim = edim;
	}

	public Boolean getEweight() {
		return eweight;
	}

	public void setEweight(Boolean eweight) {
		this.eweight = eweight;
	}

	public Boolean getEshippingpo() {
		return eshippingpo;
	}

	public void setEshippingpo(Boolean eshippingpo) {
		this.eshippingpo = eshippingpo;
	}

	public Boolean getEshiplot() {
		return eshiplot;
	}

	public void setEshiplot(Boolean eshiplot) {
		this.eshiplot = eshiplot;
	}

	public Boolean getComment() {
		return comment;
	}

	public void setComment(Boolean comment) {
		this.comment = comment;
	}

	public Boolean getSignname() {
		return signname;
	}

	public void setSignname(Boolean signname) {
		this.signname = signname;
	}

	public Boolean getDestination() {
		return destination;
	}

	public void setDestination(Boolean destination) {
		this.destination = destination;
	}
}
